package com.first.order.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.first.common.pojo.Order;
import com.first.common.pojo.TPayLog;
import com.first.common.vo.Result;
import com.first.order.dao.TPLogDao;
import com.first.order.service.TPLogService;
import com.first.order.vo.OrderVo;
import com.first.order.vo.TPLogVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: SecondProject
 * @description:
 * @author: 李榕轩
 * @create: 2023-05-29 09:37
 **/
@RestController
@RequestMapping("order")
@Api(tags = "序列号接口类")
public class TPayLogController {
    @Autowired
    private TPLogService tpLogService;
    @PostMapping("/queryOrderAndPayLog/{Id}")
    @ApiOperation(value = "条件查询")
    public Result queryOrderAndPayLog(@PathVariable String Id) {
        //System.out.println(userVo);
        TPayLog all = tpLogService.findAll(Id);

        return Result.success(all);
    }

    @PostMapping("/pay/createWeiXin/{id}/{HuiYuanId}")
    @ApiOperation("创建订单")
    public Result createWeiXin(@PathVariable String id,@PathVariable String HuiYuanId){
       return tpLogService.createWeiXin(id,HuiYuanId);
    }

    @PostMapping("/pay/getPayStatus/{orderN0}")
    @ApiOperation("查看订单状态")
    public Result getPayStatus(@PathVariable String orderN0){
      return  tpLogService.getPayStatus(orderN0);
    }



}
